package com.scedu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;

@Controller
@RequestMapping("/encode")
public class EncordingController {
    @RequestMapping("/test1")
    public  String test1(String name, Model model, HttpServletRequest request) throws UnsupportedEncodingException {
        request.setCharacterEncoding("UTF-8");
        System.out.println("name="+name);
        model.addAttribute("msg",name);
        return "/hello";
    }
}
